package component

type (
	// PreRequestFilterFunc 定义Web请求路由前的过滤器，如echo框架Pre函数添加的过滤器
	PreRequestFilterFunc func(next RequestHandlerFunc) RequestHandlerFunc
)

var (
	preFilters = make([]PreRequestFilterFunc, 0, 16)
)

// RegisterPreFilter 注册路由前的过滤器
func RegisterPreFilter(pre PreRequestFilterFunc) {
	preFilters = append(preFilters, pre)
}

func PreFilters() []PreRequestFilterFunc {
	return preFilters
}
